# coding: utf8

from PySide.QtGui import QLabel

class hehe:
    Name = 'hehe'
    Type = 'ENHANCER'
    Menus = [{
        'text': 'hehe',
        'icon_size': (25, 25),
        'icon': 'plugins/test.png',
        'trigger': 'tst222',
        'tool_tip': u'这是一个测试插件的按钮',
        }]
    Buttons = [{
        'text': '',
        'size': (30, 30),
        'icon_size': (25, 25),
        'icon': 'plugins/test.png',
        'flat': True,
        'trigger': 'tstt',
        'tool_tip': u'这是一个测试插件的按钮',
        }]
    Widgets = [{
        'widget_text': 'hello world',
        'widget': QLabel('hello'),
        }]
    def __init__(self, parent = None):
        self.widget = self.Widgets[0]['widget']
        self.collector = None
        self.parent = parent
        self.functions = {
                'tstt': self.tstt,
                'tst222': self.tst222,
                }
        self.b = 'yes'

    def tstt(self):
        print 'haha'
        s = open(self.collector()['settings_file']).read()
        self.widget.setText(s)

    def tst222(self):
        print 'Ouch!'

